/**
 * create by young (young2f@outlook.com) on 2020/9/12
 */

'use strict';
import React from 'react';
import {connect} from 'dva/index';
import {Card, Col, DatePicker, Form, Row, Select, Statistic, Table} from 'antd';
import styles from '../../index.less';
import ViewTitle from '../../../components/ViewTitle';
import FormBase from '../../../components/Base/FormBase';
import moment from 'moment';
import 'moment/locale/zh-cn';

moment.locale('zh-cn');
const {RangePicker} = DatePicker;
const _ = require('lodash');

const {Option} = Select;
@Form.create()
@connect(({
            user,
            global,
            dynamicLabel,
            procure,
            finance
          }) => ({...user, ...global, ...procure, ...finance, ...dynamicLabel}))
export default class PaymentTax extends FormBase {
  constructor(props) {
    super(props);
    this.state = {};
  }

  tableCols() {
    const model = this.props[`ReceiptModel`];
    return this.getTableColumns(model);
  }

  render() {
    const {taxAssess = {}} = this.props;
    const {receiptTax, receiptList} = taxAssess;

    return <div>
      <div style={{background: '#ECECEC', padding: '30px'}}>
        <Row gutter={16}>
          <Col span={6}>
            <Card>
              <Statistic
                title="应付总税额"
                value={receiptTax}
                precision={2}
                valueStyle={{color: '#11f'}}
                suffix="元"
              />
            </Card>
          </Col>

        </Row>
      </div>
      <ViewTitle
        title={'收入记录'}
      ></ViewTitle>
      <Table
        className={styles.antTable}
        bordered={true}
        columns={this.tableCols()}
        dataSource={receiptList}
        scroll={{x: true}}
        pagination={true}
        //scroll={{ x: 1300 }}
      ></Table>

    </div>;
  }
}
